package demo_10_09_01;

/**
 * @author:连志鹏
 * @className:Main
 * @descrption:
 * @date: 2021/10/9 14:55
 * @version: 0.1
 * @since: 1.8
 */
public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.func(new Dog());
        main.func(new Animal());
    }
//    public void func(Animal animal) {
//        animal.eat();
//        animal.shut();
//    }

    public void func(Object object){

    }
}
class Animal {
    public void eat(){
        System.out.println("动物进食");
    }
    public void shut(){
        System.out.println("动物，叫");
    }
}
class Dog extends Animal{
    @Override
    public void eat() {
        System.out.println("狗吃骨头");
    }
    @Override
    public void shut() {
        System.out.println("狗叫");
    }
}